package tests.user;


/**
 * Copyright 2007, 2008 Viera K. Proulx
 * This program is distributed under the terms of the 
 * GNU Lesser General Public License (LGPL)
 */

/**
 * <P>A sample abstract class to verify that tests include the common
 * field defined in the abstract class, as well as concrete methods
 * defined in the abstract class.</P>
 *
 * @author Viera K. Proulx
 * @since 29 October 2007
 */
public abstract class ALibItem{
  public String title;
  public int catNo;
  
  /**
   * A concrete method to be used in testing the tester ---
   * involves the common field
   * 
   * @param title a String to compare with this title
   * @return true if the given title matches this title
   */
  public boolean sameTitle(String title){
    return this.title.equals(title);
  }
  
  /**
   * Compare the length of the title against ???
   * 
   * @return true if the title has the same length as ???
   */
  abstract public boolean sameLength();
  
  /**
   * Override the toString method to test the printing feature
   * @return a String representation of this book
   */
  public String toString(){
  	return "Book title is: " + this.title +  
  	       ", catalog no: " + this.catNo;
  }
}

/*
    +-------------------------------+
    | abstract ALibItem             |
    +-------------------------------+
    | String title                  |
    | int catNo                     |
    +-------------------------------+
    | boolean sameTitle(String)     |
    | abstract boolean sameLength() |
    +-------------------------------+
                 / \
                 ---
                  |
        --------------------------------------
        |                                    |
 +----------------------------+  +------------------------+
 | ALibItemBook               |  | abstract ALibItemCD    |
 +----------------------------+  +------------------------+
 | String author              |  | int noDisks            |
 +----------------------------+  +------------------------+
 | boolean sameLength()       |  | boolean sameLength()   |
 | boolean sameAuthor(String) |  | boolean manyDisks(int) |
 +----------------------------+  +------------------------+
                                          / \
                                          ---
                                           |
                 --------------------------------------
                 |                                    |
    +----------------------------+  +----------------------------+
    | ALibItemAudioBook          |  | ALibItemMusic              |
    +----------------------------+  +----------------------------+
    | String author              |  | String artist              |
    +----------------------------+  +----------------------------+
    | boolean sameLength()       |  | boolean sameArtist(String) |
    | boolean sameAuthor(String) |  +----------------------------+
    +----------------------------+

Required method tests:

ALibItemBook: 
sameTitle (defined in the super class)
sameLength (abstract in the super class, defined here)
sameAuthor (defined only in this class)

ALibItemAudioBook: 
sameTitle (defined in the super-super class)
sameLength (overrides the implementation in the super class)
manyDisks (implemented in the super class)
sameAuthor (defined only in this class)

ALibItemMusic
sameTitle (defined in the super class)
sameLength (abstract in the super-super class, implemented in the super class)
sameArtist (defined only in this class)
*/